#include "log_level.hpp"

namespace clogs
{
    std::string logLevelToString(LogLevel level) 
    {
        switch (level) 
        {
            case LogLevel::DEBUG:
                return "DEBUG";
            case LogLevel::INFO:
                return "INFO";
            case LogLevel::WARNING:
                return "WARNING";
            case LogLevel::ERROR:
                return "ERROR";
            case LogLevel::CRITICAL:
                return "CRITICAL";
            default:
                return "UNKNOWN";
        }
    }

    LogLevel stringToLogLevel(const std::string& levelStr) 
    {
        if (levelStr == "DEBUG") return LogLevel::DEBUG;
        if (levelStr == "INFO") return LogLevel::INFO;
        if (levelStr == "WARNING") return LogLevel::WARNING;
        if (levelStr == "ERROR") return LogLevel::ERROR;
        if (levelStr == "CRITICAL") return LogLevel::CRITICAL;
        return LogLevel::UNKNOWN;
    }
}

